home *** CD-ROM | disk | FTP | other *** search
/ Champak 45 / Vol 45.iso / games / cocoon.swf / scripts / frame_18 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  684 b   |  31 lines

  1. stopAllSounds();
  2. _root.bgm.setVolume(100);
  3. _root.bgm.start(0,999);
  4. Math.formatDecimals = function(num, digits)
  5. {
  6.    if(digits <= 0)
  7.    {
  8.       return Math.round(num);
  9.    }
  10.    var tenToPower = Math.pow(10,digits);
  11.    var cropped = String(Math.round(num * tenToPower) / tenToPower);
  12.    if(cropped.indexOf(".") == -1)
  13.    {
  14.       cropped += ".0";
  15.    }
  16.    var halves = cropped.split(".");
  17.    var zerosNeeded = digits - halves[1].length;
  18.    var i = 1;
  19.    while(i <= zerosNeeded)
  20.    {
  21.       cropped += "0";
  22.       i++;
  23.    }
  24.    return cropped;
  25. };
  26. _root.nuts = 0;
  27. _root.timeleft = _root.leveltime;
  28. _root.nutneeded = _root.level + 4;
  29. _root.meter_rate = 20;
  30. stop();
  31.